function add0(m) {
  return m < 10 ? '0' + m : m;
}
export default function format(time1) {
  if (time1 == '' || time1 == null) {
    return '';
  }
  var time = new Date(time1);
  var y = time.getFullYear();
  var m = time.getMonth() + 1;
  var d = time.getDate();
  var h = time.getHours();
  var mm = time.getMinutes();
  var s = time.getSeconds();
  return y + '-' + add0(m) + '-' + add0(d) + ' ' + add0(h) + ':' + add0(mm) + ':' + add0(s);
}

export function TodayFormatZero(time1) {
  if (time1 == '' || time1 == null) {
    return '';
  }
  var time = new Date(time1);
  var y = time.getFullYear();
  var m = time.getMonth() + 1;
  var d = time.getDate();

  return y + '-' + add0(m) + '-' + add0(d) + ' ' + add0(0) + ':' + add0(0) + ':' + add0(0);
}
